def blank? obj
	return true if obj.nil? || obj.empty?
	return false
end

answers = {}
Dir.glob("./*result.txt") do | filename |
 puts filename
 f = open(filename)
 f.each_line do |line|
 	line.chomp!
	info = line.split("\t")
	no = info[0]
	ans = info[1]
	
	if !blank?(answers[no]) && !blank?(ans) && answers[no] != ans
		puts "warn " + no + " 1:"+answers[no] + " 2:" + ans.to_s
	end
	unless blank?(ans)
		answers[no] = ans || ""
	end
 end
end

open("all.txt", "w") do |out|
	answers.each do |no, ans|
		out.puts no + "\t" + ans
	end
end

